package com.hanrui.android.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hanrui.android.R;
import com.hanrui.android.model.BaseFilesBean;

import javax.inject.Inject;

/**
 * 附件查看
 */

public class DownAdapter extends BaseQuickAdapter<BaseFilesBean,BaseViewHolder> {
    @Inject
    public DownAdapter(){
        super(R.layout.item_down);
    }

    @Override
    protected void convert(BaseViewHolder helper, BaseFilesBean item) {

        helper.setText(R.id.name,item.getFileName());
        if (item.isDown()) {

            helper.setGone(R.id.start,false);
            helper.setGone(R.id.folder_open,true);

        }else {

            helper.setGone(R.id.start,true);
            helper.setGone(R.id.folder_open,false);
        }

        helper.addOnClickListener(R.id.start);
        helper.addOnClickListener(R.id.folder_open);

    }
}